package cn.net.shuxing.yifu.mysiteforme.admin.controller.system;

import cn.net.shuxing.yifu.common.constant.OssConstant;
import cn.net.shuxing.yifu.common.dto.BaseDto;
import cn.net.shuxing.yifu.common.service.OssCommonService;
import cn.net.shuxing.yifu.common.util.JedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PictureController {

    @Autowired
    private JedisUtil jedisUtil;

    @Autowired
    private OssCommonService ossCommonService;

    @GetMapping("/back/admin/picture")
    public BaseDto getAdminPicture()
    {
        String adminPicture = jedisUtil.get("adminPicture");
        return BaseDto.ok(ossCommonService.getUrl(OssConstant.ossBucketName,adminPicture));
    }
}
